import { InfoFilled } from '@element-plus/icons-vue'
import { ElIcon, ElTooltip } from 'element-plus'

// 渲染label message
export function renderLabelMessage(label: string, msg: string) {
  return () => (
    <>
      <span>{label}</span>
      <ElTooltip placement="right" raw-content>
        {{
          content: () => <div style="max-width: 350px" v-html={msg}></div>,
          default: () => <ElIcon class="left-2px"><InfoFilled /></ElIcon>,
        }}
      </ElTooltip>
    </>
  )
}
